<template>
	<view>
		<view class="page">
			<view class="example-body">
				<uni-nav-bar background-color="#003466" color="#ffffff" :status-bar="true" @click-left="back" left-icon="arrowleft"
				 style="position: relative;">
					<view class="flex-item">任务处理记录</view>
					<view class="flex-item" style="position: absolute;top: 20px;right: 22px;">选择维护规程</view>
				</uni-nav-bar>
			</view>
			<view>
				<view v-if="current === 0" class="turn-content">
					<!-- 误报 -->
					<form @submit="formSubmit" @reset="formReset" :model="dealInfo">
						<view class="turn-misson">
							<view class="misson-fs">处理方式</view>
							<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" style-type="button"
							 active-color="#FBA92B"></uni-segmented-control>
						</view>
						<view class="turn-textarea">
							<view class="turn-result">误报备注</view>
							<textarea v-model="dealInfo.result" :disabled="disabledFlag" placeholder="输入维护结果" class="turn-textareawords" />
							</view>
				    </form>
					<!-- <view class="turn-result">现场照片</view>
					<view class="turn-pic">
						<view class="turn-solid solid-png">
							<image src="../../../static/images/movepng.png" mode=""></image>
						</view>
						<view class="turn-solid solid-remove">
							<view class="removepng"></view>
						</view>
						<view class="turn-solid"></view>
						<view class="turn-solid"></view>
					</view> -->
				</view>
				
				<view v-if="current === 1" >
					<!-- 设备故障 -->
					<form @submit="formSubmit" @reset="formReset" :model="dealInfo" >
						<view  class="turn-content"  v-if="eqFlag">
							<view class="turn-misson">
								<view class="misson-fs">处理方式</view>
								<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" style-type="button" active-color="#FBA92B"></uni-segmented-control>
							</view>
							<view class="part uni-form-item uni-column">
								<view class="add-manage" @click="addManage" v-show="submitReadFlag">
									<view class="add-pic"><image src="../../../static/images/add-notes.png" mode=""></image></view>
									<view class="add-notes">添加备件</view>
								</view>
								<view class="manage-name" v-for="(item, index) in dealInfo.sparePart.listOrderDetail" :key="index">
									<view class="manage-name-add">
										<view class="add-left">备件名称</view>
										<view style="width: 86%; margin: auto;float: right;" class="part-select">
											<xfl-select 
											:list="beijianList"
											:showItemNum="2" 
											:initValue="item.equipmentRowGuid"
											:isCanInput="false"  
											:style_Container="listBoxStyle"
											@visible-change = 'visibleChange(index)'
											@choose-name = "getChoose"
											:disabled="disabledFlag"
											>
											</xfl-select>
										</view>
									</view>
									<view class="manage-name-add">
										<view class="add-left">备件方式</view>
										<view style="width: 86%; margin: auto;float: right;">
											<xfl-select 
											:list="lists"
											:initValue="operationType"
											:disabled="true"
											:showItemNum="2" 
											:isCanInput="false"  
											:style_Container="listBoxStyle"
											@visible-change = 'visibleChange'
											:clearable="false"
											>
											</xfl-select>
										</view>
									</view>
									<view class="manage-name-add">
										<view class="add-left">备件数量</view>
										<view class="move-number" @click="getBoxIndex(index)">
											<uni-number-box @change="bindChange" :boxValue="item.number"  :disabled="disabledFlag"></uni-number-box>
										</view>
									</view>
									<view class="move-notes" v-show="submitReadFlag" @click="delateManage(index)"></view>
								</view>
							</view>
							<view class="turn-textarea uni-form-item uni-column">
								<view class="turn-result">处理结果</view>
								<textarea  :disabled="disabledFlag" v-model="dealInfo.result" placeholder="输入维护结果" class="turn-textareawords"/>
							</view>
							<view class="turn-textarea uni-form-item uni-column" >
								<view class="turn-result">厂商信息</view>
								<textarea  :disabled="disabledFlag" v-model="dealInfo.manufacturer" placeholder="输入厂商信息" class="turn-textareawords"/>
							</view>
						</view>
					</form>
					
					<!-- 备品备件 -->
					<form @submit="formSubmit" @reset="formReset" :model="dealInfo" >
						<view  class="turn-content" v-if="partFlag">
							<view class="turn-misson">
								<view class="misson-fs">处理方式</view>
								<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" style-type="button" active-color="#FBA92B"></uni-segmented-control>
							</view>
							<view class="part uni-form-item uni-column">
								<view class="add-manage" @click="addManage" v-show="submitReadFlag">
									<view class="add-pic"><image src="../../../static/images/add-notes.png" mode=""></image></view>
									<view class="add-notes">添加备件</view>
								</view>
								<view class="manage-name" v-for="(item, index) in dealInfo.sparePart.listOrderDetail" :key="index">
									<view class="manage-name-add">
										<view class="add-left">备件名称</view>
										<view style="width: 86%; margin: auto;float: right;" class="part-select">
											<xfl-select 
											:list="beijianList"
											:showItemNum="2" 
											:initValue="item.equipmentRowGuid"
											:isCanInput="false"  
											:disabled="disabledFlag"
											:style_Container="listBoxStyle"
											@visible-change = 'visibleChange(index)'
											@choose-name = "getChoose"
											>
											</xfl-select>
										</view>
									</view>
									<view class="manage-name-add">
										<view class="add-left">备件方式</view>
										<view style="width: 86%; margin: auto;float: right;">
											<xfl-select 
											:list="lists"
											:initValue="operationType"
											:disabled="true"
											:showItemNum="2" 
											:isCanInput="false"  
											:style_Container="listBoxStyle"
											@visible-change = 'visibleChange'
											:clearable="false"
											>
											</xfl-select>
										</view>
									</view>
									<view class="manage-name-add">
										<view class="add-left">备件数量</view>
										<view class="move-number" @click="getBoxIndex(index)">
											<uni-number-box @change="bindChange" :boxValue="item.number"  :disabled="disabledFlag"></uni-number-box>
										</view>
									</view>
									<view class="move-notes"  v-show="submitReadFlag" @click="delateManage(index)"></view>
								</view>
							</view>
							<!-- <view class="turn-textarea uni-form-item uni-column">
								<view class="turn-result">处理结果</view>
								<textarea  v-model="dealInfo.result" :disabled="disabledFlag" placeholder="输入维护结果" class="turn-textareawords"/>
							</view> -->
						</view>
					</form>
					
					<!-- 物资情况 -->
					<form @submit="formSubmit" @reset="formReset" :model="dealInfo" >
						<view  class="turn-content" v-if="goodsFlag">
							<view class="turn-misson">
								<view class="misson-fs">处理方式</view>
								<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" style-type="button" active-color="#FBA92B"></uni-segmented-control>
							</view>
							<view class="part uni-form-item uni-column">
								<view class="add-manage" @click="addManage" v-show="submitReadFlag">
									<view class="add-pic"><image src="../../../static/images/add-notes.png" mode=""></image></view>
									<view class="add-notes">添加备件</view>
								</view>
								<view class="manage-name" v-for="(item, index) in dealInfo.supplyOrder.listOrderDetail" :key="index">
									<view class="manage-name-add">
										<view class="add-left">物资名称</view>
										<view style="width: 86%; margin: auto;float: right;" class="part-select">
											<xfl-select 
											:list="wuziList"
											:showItemNum="2" 
											:initValue="item.tableRowGuid"
											:isCanInput="false"  
											:disabled="disabledFlag"
											:style_Container="listBoxStyle"
											@visible-change = 'visibleChange(index)'
											@choose-name = "getChoose"
											>
											</xfl-select>
										</view>
									</view>
									<view class="manage-name-add">
										<view class="add-left">备件方式</view>
										<view style="width: 86%; margin: auto;float: right;">
											<xfl-select 
											:list="lists"
											:initValue="operationType"
											:disabled="true"
											:showItemNum="2" 
											:isCanInput="false"  
											:style_Container="listBoxStyle"
											@visible-change = 'visibleChange'
											:clearable="false"
											>
											</xfl-select>
										</view>
									</view>
									<view class="manage-name-add">
										<view class="add-left">备件数量</view>
										<view class="move-number" @click="getBoxIndex(index)">
											<uni-number-box @change="bindChange" :boxValue="item.number" :disabled="disabledFlag"></uni-number-box>
										</view>
									</view>
									<view class="move-notes" v-show="submitReadFlag" @click="delateManage(index)"></view>
								</view>
							</view>
							<view class="turn-textarea uni-form-item uni-column">
								<view class="turn-result">处理结果</view>
								<textarea v-model="dealInfo.result"  placeholder="输入维护结果" class="turn-textareawords"/>
							</view>
						</view>
					</form>
					
					<!-- 维护任务 环境报警 应急任务-->
					<form @submit="formSubmit" @reset="formReset" :model="dealInfo" >
						<view  class="turn-content" v-if="resultFlag">
							<view class="turn-misson">
								<view class="misson-fs">处理方式</view>
								<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" style-type="button" active-color="#FBA92B"></uni-segmented-control>
							</view>
							<view class="turn-textarea">
								<view class="turn-result">处理结果</view>
								<textarea v-model="dealInfo.result" placeholder="输入维护结果" class="turn-textareawords"/>
							</view>
						</view>
					</form>
				</view>
					
			</view>
				
				<view class="records_tj" @click="submit" v-show="submitReadFlag">提交</view>
				<view class="processing_tj" v-show="submitFlag"  @click="submitCreat">提交并生成维护规程</view>
		</view>
	</view>
</template>

<script>
import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue';
import uniIcon from '@/components/uni-icon/uni-icon.vue';
import uniSegmentedControl from '@/components/uni-segmented-control/uni-segmented-control.vue'
import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue'
import xflSelect from '@/components/xfl-select/xfl-select.vue'
export default {
	components: {
		uniNavBar,
		uniIcon,
		uniSegmentedControl,
		uniNumberBox,
		xflSelect
	},
	data(){
		return{
			items:['误报','处理'],
			current: 0,
			listBoxStyle: `height: 40px; font-size: 16px;`,
			list: [],
			lists: [],
			disabledFlag:false,
			dealInfo:{
				id: "",//维护任务唯一标识
				doMethod:"",//处理方式
				operater: "测试人",//操作人
				result: "",//维护结果
				sparePart: {
					id: "",
					order: "",
					createTime: "",
					tenantId: 0,
					listOrderDetail: []
				},
				supplyOrder: {
					id: "",
					order: "",
					createTime: "",
					tenantId: 0,
					listOrderDetail: []
				},
				manufacturer:"",//厂商信息
			},//处理信息
			sparepartList:[], //设备名
			supplyList:[], //物资名
			beijianList:[],
			wuziList:[],
			eqFlag:true, //设备设施
			partFlag:false, //备品备件
			goodsFlag:false, //物资情况
			resultFlag:false, //维护任务 环境报警 应急任务
			operationType:"出库",
			eqId:"",
			eqNameIndex:0,//记录下表单id
			numberIndex:0,//表单备件数量id
			submitFlag:false,
			submitReadFlag:true,
			infoResult:"", //传来的维护内容
			infoCreateTime:"",//传来的创建时间
			systemId:"",//传来的系统id
			equipmentName:"",
			toMethsRember:""
		}
	},
	methods:{
		visibleChange(index){ // 获取index
			this.eqNameIndex=index;
		},
		
		getBoxIndex(index){ // 获取index
			this.numberIndex=index;
		},
		
		bindChange(newVal){ //备件数量赋值
		let number= parseInt(newVal);
		console.log(number);
		console.log(typeof this.numberIndex)
		console.log(this.dealInfo.sparePart.listOrderDetail[this.numberIndex])
			this.dealInfo.sparePart.listOrderDetail[this.numberIndex].number = number;
			this.dealInfo.supplyOrder.listOrderDetail[this.numberIndex].number = number;
		},
		
		getChoose(value){ //选择备品名称转换
		debugger;
		console.log(this.dealInfo.sparePart.listOrderDetail[this.eqNameIndex])
			let equipmentRowGuid;
			this.sparepartList.forEach(e=>{
				if(e.name == value){
					this.dealInfo.sparePart.listOrderDetail[this.eqNameIndex].equipmentRowGuid=e.id;
					this.dealInfo.supplyOrder.listOrderDetail[this.eqNameIndex].equipmentRowGuid=e.id;
				}
			})
		},
		
		//误报or处理
		onClickItem(index) {
			if(this.toMethsRember==""){
				if (this.current !== index) {
					this.current = index;
				};
				if(index==0){
					this.dealInfo.doMethod="001"
				}else{
					this.dealInfo.doMethod="002"
					this.dealInfo.order=this.$helper.createDateId();//出入库单号
				}
			}
		},
		
		//返回
		back() {
			uni.navigateBack({
				delta: 1
			});
		},
		
		// 备品备件默认实例工厂
		SpareSpartFactory() {
			return {
				orderRowGuid: "",
				sparePartRowGuid: "",
				operationType: "",
				number: 0,
				equipmentRowGuid:"",
				tenantId: 1,
			}//盘点信息
		},
		
		//物资默认实例工厂
		supplyFactory() {
			return {
				orderRowGuid: "",//出入库唯一标识
				supplyRowGuid:"",//物资唯一标识
				operationType: "002",//出入库方式
				number: 0,//数量
				tenantId: 1
			}//盘点信息
		},
		
		//备品备件增
		addManage(){
			if(this.toMethsRember==""){
				this.dealInfo.sparePart.listOrderDetail.push(this.SpareSpartFactory());
			}else{
				uni.showToast({
					title: '不可操作！',
					duration: 2000,
					icon:'none'
				});
			}
			// this.dealInfo.sparePart.listOrderDetail.forEach(e=>{
			// 	e.sparePartRowGuid = this.innerInfo.equipmentRowGuid;
			// })
		},
		
		//实例工厂增
		addFoodsManage(){
			if(this.toMethsRember==""){
				this.dealInfo.supplyOrder.listOrderDetail.push(this.supplyFactory());
			}else{
				uni.showToast({
					title: '不可操作！',
					duration: 2000,
					icon:'none'
				});
			}
		},
		
		//删表单
		delateManage(index){
			if(this.toMethsRember==""){
				this.dealInfo.sparePart.listOrderDetail.splice(index,1)
			}else{
				uni.showToast({
					title: '不可操作！',
					duration: 2000,
					icon:'none'
				});
			}
		},
		
		//提交
		submit(){
			this.dealInfo.operater = "管理员";
			this.dealInfo.sparePart.id = this.$helper.newGuid();
			this.dealInfo.sparePart.order = this.$helper.newGuid();
			this.dealInfo.sparePart.createTime = this.$helper.dateFormat(new Date(),false);
			this.dealInfo.sparePart.tenantId = 1;
			this.dealInfo.sparePart.listOrderDetail.forEach(e=>{
				e.orderRowGuid = this.dealInfo.sparePart.id;
				e.tenantId = 1;
				if(this.operationType == "出库"){
					e.operationType="002";
				}else if(this.operationType == "入库"){
					e.operationType="001";
				}
				e.sparePartRowGuid=this.eqId;
			});
			
			
			this.dealInfo.operater = "管理员";
			this.dealInfo.supplyOrder.id = this.$helper.newGuid();
			this.dealInfo.supplyOrder.order = this.$helper.newGuid();
			this.dealInfo.supplyOrder.createTime = this.$helper.dateFormat(new Date(),false);
			this.dealInfo.supplyOrder.tenantId = 1;
			this.dealInfo.supplyOrder.listOrderDetail.forEach(e=>{
				e.orderRowGuid = this.dealInfo.supplyOrder.id;
				e.tenantId = 1;
				if(this.operationType == "出库"){
					e.operationType="002";
				}else if(this.operationType == "入库"){
					e.operationType="001";
				}
				e.supplyRowGuid=this.eqId;
			});
			
			this.$api.MaintenanceTask.DoMaintenanceTask(this.dealInfo).then( res => {
				uni.showToast({
					title: '接收成功',
					duration: 2000
				});
				wx.navigateTo({
					url:'maintenance-manage-list'
				})
			})
			// .catch(res => {
			// 	uni.showToast({
			// 		title: '处理失败，请联系管理员！',
			// 		duration: 2000,
			// 		icon:'none'
			// 	});
			// });
		},
		
		//提交并生成维护规程
		submitCreat(){
			let info = {
				systemName: this.systemId, //所属系统 只有设备故障有
				largeCategory: "", //所属大类 不传
				smallCategory: "", //所属小类 不传
				maintainType: "001", //维护类型 默认日常维护001 定期维护002 累计运行003
				cycle: "", //周期 创建时间-当前时间
				timeUnit: "", //时间单位
				maintainContent: this.infoResult, //维护内容
				remark: "", //备注
				tenantId: 1,
			  };
			  
			let date = new Date(this.$helper.dateFormat(this.infoCreateTime,false));
			let misTime=new Date()-date;
			
			//计算出相差天数
			let days=Math.floor(misTime/(24*3600*1000));
			 
			//周数
			let week=Math.floor(days/7); 
			
			//以30天为一个月不够精准严谨
			let monthDiff=Math.floor(days/30);
			
			//计算出相差年数
			let yearDiff=Math.floor(monthDiff/12);//获取相差的年份
			 
			//计算出小时数
			let leave1=misTime%(24*3600*1000)    //计算天数后剩余的毫秒数
			let hours=Math.floor(misTime/(3600*1000))
			
			//计算相差分钟数
			let leave2=leave1%(3600*1000)        //计算小时数后剩余的毫秒数
			let minutes=Math.floor(misTime/(60*1000))
			 
			//计算相差秒数
			let leave3=leave2%(60*1000)      //计算分钟数后剩余的毫秒数
			let seconds=Math.round(misTime/1000)
			
			// console.log(days);  //天 004
			// console.log(week);  //周 003
			// console.log(monthDiff); //月 002
			// console.log(yearDiff); //年 001
			// console.log(hours); //小时 005
			// console.log(minutes);
			// console.log(seconds);
			if(hours<24){ //小时24小时 是小时
				info.cycle=Math.round(hours);
				info.timeUnit="005";
				info.maintainType="003";
			}else if(days>1 && week<1){ //大于一天 小于一周 是天
				info.cycle=Math.round(days);
				info.timeUnit="004";
				info.maintainType="001";
			}else if(week>1 && monthDiff<1){ //大于一周 小于一个月 是周
				info.cycle=Math.round(week);
				info.timeUnit="003";
				info.maintainType="001";
			}else if(monthDiff>1 && yearDiff<1){ //大于一个月 小于一年 是月
				info.cycle=Math.round(monthDiff);
				info.timeUnit="002";
				info.maintainType="002";
			}else if(yearDiff>1){
				info.cycle=Math.round(yearDiff);
				info.timeUnit="001";
				info.maintainType="002";
			};
			
			this.$api.MaintenanceTask.MaintenanceRuleCreate(info).then(res=>{
				if(res[1].statusCode == 200){
					uni.showToast({
						title: '生成维护规程',
						duration: 2000,
					});
				}
			}).catch(res => {
				uni.showToast({
					title: '维护规程生成失败',
					duration: 2000,
					icon:'none'
				});
			});  
			this.dealInfo.operater = "管理员";
			this.dealInfo.sparePart.id = this.$helper.newGuid();
			this.dealInfo.sparePart.order = this.$helper.newGuid();
			this.dealInfo.sparePart.createTime = this.$helper.dateFormat(new Date(),false);
			this.dealInfo.sparePart.tenantId = 1;
			this.dealInfo.sparePart.listOrderDetail.forEach(e=>{
				e.orderRowGuid = this.dealInfo.sparePart.id;
				e.tenantId = 1;
				if(this.operationType == "出库"){
					e.operationType="002";
				}else if(this.operationType == "入库"){
					e.operationType="001";
				}
				e.sparePartRowGuid=this.eqId;
			});
			
			this.dealInfo.operater = "管理员";
			this.dealInfo.supplyOrder.id = this.$helper.newGuid();
			this.dealInfo.supplyOrder.order = this.$helper.newGuid();
			this.dealInfo.supplyOrder.createTime = this.$helper.dateFormat(new Date(),false);
			this.dealInfo.supplyOrder.tenantId = 1;
			this.dealInfo.supplyOrder.listOrderDetail.forEach(e=>{
				e.orderRowGuid = this.dealInfo.supplyOrder.id;
				e.tenantId = 1;
				if(this.operationType == "出库"){
					e.operationType="002";
				}else if(this.operationType == "入库"){
					e.operationType="001";
				}
				e.supplyRowGuid=this.eqId;
			});
			this.$api.MaintenanceTask.DoMaintenanceTask(this.dealInfo).then( res => {
				uni.showToast({
					title: '接收成功',
					duration: 2000
				});
				wx.navigateTo({
					url:'maintenance-manage-list'
				})
			}).catch(res => {
				uni.showToast({
					title: '处理失败，请联系管理员！',
					duration: 2000,
					icon:'none'
				});
			});  
		},
		
		// 所需值
		async getInfo(){
			await this.$api.MaintenanceTask.GetArchvieSparePart().then(res => {
				this.beijianList=[];
				this.sparepartList = res[1].data.result;
				this.sparepartList.forEach(ele => {
					this.beijianList.push(ele.name);
				})
			}).catch(res => {
				uni.showToast({
					title: '备件名获取失败',
					duration: 2000,
					icon:'none'
				});
			});
			await this.$api.MaintenanceTask.getAllSupplyData().then(res => {
				this.wuziList=[];
				this.supplyList = res[1].data.result;
				this.supplyList.forEach(ele => {
					this.wuziList.push(ele.name);
				})
			}).catch(res => {
				uni.showToast({
					title: '物资名获取失败',
					duration: 2000,
					icon:'none'
				});
			});
		}
	},
	
	onLoad: async function(option) {
		let option1 = JSON.parse(option.passParam);
		
		this.toMethsRember = "";
		await this.getInfo();
		
		let paramsDeal={ id:option1.id }
		if(option1.status=="003"){
			//详情 只读
			this.disabledFlag=true;
			this.submitReadFlag=false;
			this.submitFlag=false;
			this.$api.MaintenanceTask.TaskDetailGet(paramsDeal).then(res => {
				
				this.dealInfo=res[1].data.result;
				console.log(this.dealInfo);
				if(this.dealInfo.result==""){
					this.dealInfo.result="暂无维护结果.."
				}
				this.toMethsRember = this.dealInfo.doMethod;
				if(this.dealInfo.doMethod=="002"){
					this.items=["处理"];
					this.current=1;
				}else if(this.dealInfo.doMethod=="001"){
					this.items=["误报"];
					this.current=0;
				};
				
				if(this.dealInfo.sparePart.listOrderDetail != null){
					this.dealInfo.sparePart.listOrderDetail.forEach(e=>{
						this.sparepartList.forEach(ele=>{
							if(e.equipmentRowGuid == ele.id){
								e.equipmentRowGuid = ele.name;
							}
						})
					});
				};
				console.log(this.dealInfo.supplyOrder.listOrderDetail)
				if(this.dealInfo.supplyOrder.listOrderDetail != null){
					this.dealInfo.supplyOrder.listOrderDetail.forEach(e=>{
						this.wuziList.forEach(ele=>{
							if(e.equipmentRowGuid == ele.id){
								e.equipmentRowGuid = ele.name;
							}
						})
					})
				}
				
			})
			// .catch(res => {
			// 	uni.showToast({
			// 		title: '处理记录获取失败',
			// 		duration: 2000,
			// 		icon:'none'
			// 	});
			// });	
		};
		
		if(option1.status != "003"){
			// 编辑
			this.systemId=option1.systemId;
			this.infoResult=option1.result;
			this.infoCreateTime=option1.createTime;
			this.dealInfo.doMethod="001"; //默认误报
			this.dealInfo.id = option1.id; //任务id
			this.eqId = option1.eqId;
			let category=option1.category;
			if( category=="001" || category=="005" ||category=="006" ){
				//维护任务 环境报警 应急任务
				this.resultFlag=true;
				this.partFlag=false;
				this.goodsFlag=false;
				this.eqFlag=false;
			}else if(category=="003"){
				// 备品备件
				this.partFlag=true;
				this.resultFlag=false;
				this.goodsFlag=false;
				this.eqFlag=false;
				this.operationType="入库";
			}else if(category=="004"){
				//物资情况
				this.goodsFlag=true;
				this.resultFlag=false;
				this.partFlag=false;
				this.eqFlag=false;
				this.operationType="入库";
			}else if(category=="002"){
				//设备故障
				this.eqFlag=true;
				this.resultFlag=false;
				this.partFlag=false;
				this.goodsFlag=false;
				this.operationType="出库";
				this.submitFlag=true;
			}
		}	
	}
};
</script>

<style>
page {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	background-color: #F2F2F2;
}

.flex-item {
	font-size: 20px;
	text-align: center;
	display: flex;
	justify-content: center;
	align-items: center;
}

.uni-icon {
	padding-left: 42%;
}

.uni-navbar__header-btns{
	padding: 0;
}

.uni-navbar__header-btns:last-child{
	width: 120px;
}

.uni-numbox__minus, .uni-numbox__plus{
	width: 34px;
	height: 32px;
	font-size: inherit;
	line-height: 32px;
}

.uni-numbox__value{
	width: 46px;
	height: 32px;
	background-color: #F8F8F8;
	display: flex;
	align-items: center;
}

.uni-numbox{
	height: 100%;
}

input{
	min-height: inherit;
}

.add-left{
	color: #666666;
	float: left;
	line-height: 40px;
}

.add-right{
	color: #333333;
	float: right;
	margin-right: 8px;
}

.move-number{
	float: right;
	margin-top: 5px;
}

.add-right-jt{
	width: 7px;
	height: 11px;
	background: url(../../../static/images/righticon.png) no-repeat;
	background-size: 100% 100%;
	float: right;
	margin: 4px;
}

.manage-name-add{
	font-size: 14px;
	padding: 6px 10px;
	overflow: hidden;
}

.manage-name{
	width: 94%;
	height: 100%;
	background-color: #F2F2F2;
	margin: 0 auto;
	margin-top: 18px;
	border-radius: 3px;
	padding-top: 8px;
	padding-bottom: 8px;
	position: relative;
}

.move-notes{
	width: 14px;
	height: 14px;
	background: url(../../../static/images/removepng.png) no-repeat;
	background-size: 100% 100%;
	position: absolute;
	top: -5px;
	right: -4px;
}

.add-manage{
	width: 94%;
	border: 1px dashed #E5E5E5;
	margin: 0 auto;
	margin-top: 10px;
	border-radius: 3px;
	overflow: hidden;
}

.add-notes{
	line-height: 52px;
	font-size: 16px;
	color: #191918;
	float: left;
}

.add-pic{
	width: 50px;
	height: 50px;
	display: flex;
	justify-content: center;
	align-items: center;
	float: left;
}

.add-pic image{
	max-width: 46%;
	max-height: 46%;
}

.segmented-control-item{
	line-height: inherit;
}

.segmented-control-item{
	border: none;
	border-radius: 3px;
}

.segmented-control-item.active{
	color: #FFFFFF;
	background-color: #FBA92B;
}

.segmented-control-item{
	width: 40%;
	color: #FFFFFF;
	background-color: #999999;
}

.segmented-control{
	width: 30%;
	height: 26px;
	font-size: 14px;
	line-height: 26px;
	margin: 0;
	border-radius: inherit;
	margin-left: 24px;
	border: none;
}

.turn-content {
	width: 94%;
	background-color: #ffffff;
	border-radius: 3px;
	margin: 0 auto;
	margin-top: 10px;
	overflow: hidden;
	padding-bottom: 30px;
}

.records_tj {
	width: 94%;
	height: 52px;
	color: #ffffff;
	font-size: 16px;
	line-height: 52px;
	text-align: center;
	background-color: #458cd0;
	border-radius: 3px;
	margin: 0 auto;
	margin-top: 35px;
}

.processing_tj {
	width: 94%;
	height: 52px;
	color: #458cd0;
	font-size: 16px;
	line-height: 52px;
	text-align: center;
	border: 1px solid #458cd0;
	border-radius: 3px;
	margin: 0 auto;
	margin-top: 12px;
}

.turn-misson {
	display: flex;
	overflow: hidden;
	padding: 4px;
	margin-top: 10px;
}

.misson-fs{
	color: #000000;
	font-size: 16px;
	margin-left: 10px;
	margin-top: 2px;
}

.misson-wb{
	width: 80px;
	height: 26px;
	border-radius: 3px;
	background-color: #FBA92B;
	text-align: center;
	line-height: 26px;
	color: #FFFFFF;
	font-size: 14px;
	margin-left: 15px;
}

.misson-cl{
	width: 80px;
	height: 26px;
	border-radius: 3px;
	background-color: #999999;
	text-align: center;
	line-height: 26px;
	color: #FFFFFF;
	font-size: 14px;
	margin-left: 15px;
}

.turn-result{
	height: 18px;
	font-size: 16px;
	line-height: 18px;
	color: #000000;
	margin-left: 15px;
	margin-top: 24px;
}

textarea{
	border: 1px solid #e5e5e5;
	width: 94%;
	border-radius: 3px;
}

.turn-textareawords{
	font-size: 14px;
	color: #000000;
	margin: 0 auto;
	margin-top: 10px;
	padding: 10px;
}

.area-pic{
	width: 56px;
	height: 18px;
	font-size: 14px;
	line-height: 18px;
	color: #666666;
	margin-left: 15px;
	margin-top: 24px;
}

.turn-pic{
	/* padding-left: 9%; */
	margin-top: 15px;
	display: flex;
	flex-wrap: wrap;
}

.turn-solid{
	width: 80px;
	height: 80px;
	border: 1px dashed #E5E5E5;
	margin-left: 2%;
}

.solid-png{
	display: flex;
	justify-content: center;
	align-items: center;
}

.solid-png image{
	max-width: 65%;
	max-height: 65%;
}

.solid-remove{
	position: relative;
}

.removepng{
	width: 14px;
	height: 14px;
	background: url(../../../static/images/removepng.png) no-repeat;
	background-size: 100% 100%;
	position: absolute;
	top: -6px;
	right: -6px;
}
.part-select >.show-box{
	position: inherit !important;
}
</style>
